"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ws_1 = require("ws");
var rxjs_1 = require("rxjs");
function createWebSocketClient(address, options) {
    var ws = new ws_1.default(address, options);
    var open = rxjs_1.fromEvent(ws, 'open');
    var error = rxjs_1.fromEvent(ws, 'error');
    var close = rxjs_1.fromEvent(ws, 'close');
    var message = rxjs_1.fromEvent(ws, 'message');
    var upgrade = rxjs_1.fromEvent(ws, 'upgrade');
    var ping = rxjs_1.fromEvent(ws, 'ping');
    var unexpectedResponse = rxjs_1.fromEvent(ws, 'unexpected-response');
    return rxjs_1.merge(open, error, close, message, upgrade, ping, unexpectedResponse);
}
exports.createWebSocketClient = createWebSocketClient;
